package com.smarthome.common.tools;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;

/**
 * 枚举工具类
 * 
 */
public final class EnumUtil {

    /**
     * Gets the enum list.
     * 
     * @param enumClass the enum class
     * @return the enum list.Element of list is type of map
     */
    @SuppressWarnings({ "rawtypes", "unchecked" })
    public static List getEnumList(Class enumClass) {
        return new ArrayList(EnumSet.allOf(enumClass));
    }

    /**
     * 获取同一枚举类型指定常量值列表
     * @param first
     * @param rest
     * @author Gavin
     * @return
     */
    @SuppressWarnings({ "rawtypes", "unchecked" })
    public static List getPartEnumList(Enum first, Enum... rest) {
        return new ArrayList(EnumSet.of(first, rest));
    }

}
